﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Pharmacy_management_system
{
    public partial class evlform : Form
    {
        public evlform()
        {
            InitializeComponent();
        }
        #region 判断复选框是否选中
        private void type1check()
        {

            Form1.evl_allid = Form1.evl_allid + "；";
            if (Form1.evl_allid.IndexOf("(1)1-1；") >= 0) { evl_1_1.Checked = true; evl_1_1.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(1)1-2；") >= 0) { evl_1_2.Checked = true; evl_1_2.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(1)1-3；") >= 0) { evl_1_3.Checked = true; evl_1_3.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(1)1-4；") >= 0) { evl_1_4.Checked = true; evl_1_4.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(1)1-5；") >= 0) { evl_1_5.Checked = true; evl_1_5.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(1)1-6；") >= 0) { evl_1_6.Checked = true; evl_1_6.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(1)1-7；") >= 0) { evl_1_7.Checked = true; evl_1_7.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(1)1-8；") >= 0) { evl_1_8.Checked = true; evl_1_8.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(1)1-9；") >= 0) { evl_1_9.Checked = true; evl_1_9.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(1)1-10；") >= 0) { evl_1_10.Checked = true; evl_1_10.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(1)1-11；") >= 0) { evl_1_11.Checked = true; evl_1_11.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(1)1-12；") >= 0) { evl_1_12.Checked = true; evl_1_12.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(1)1-13；") >= 0) { evl_1_13.Checked = true; evl_1_13.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(1)1-14；") >= 0) { evl_1_14.Checked = true; evl_1_14.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(1)1-15；") >= 0) { evl_1_15.Checked = true; evl_1_15.ForeColor = Color.Red; }
            Form1.evl_allid = Form1.evl_allid.Remove(Form1.evl_allid.LastIndexOf("；"), 1);
        }

        private void type2check()
        {

            Form1.evl_allid = Form1.evl_allid + "；";
            if (Form1.evl_allid.IndexOf("(2)1-1；") >= 0) { evl_2_1.Checked = true; evl_2_1.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(2)1-2；") >= 0) { evl_2_2.Checked = true; evl_2_2.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(2)1-3；") >= 0) { evl_2_3.Checked = true; evl_2_3.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(2)1-4；") >= 0) { evl_2_4.Checked = true; evl_2_4.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(2)1-5；") >= 0) { evl_2_5.Checked = true; evl_2_5.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(2)1-6；") >= 0) { evl_2_6.Checked = true; evl_2_6.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(2)1-7；") >= 0) { evl_2_7.Checked = true; evl_2_7.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(2)1-8；") >= 0) { evl_2_8.Checked = true; evl_2_8.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(2)1-9；") >= 0) { evl_2_9.Checked = true; evl_2_9.ForeColor = Color.Red; }
            Form1.evl_allid = Form1.evl_allid.Remove(Form1.evl_allid.LastIndexOf("；"), 1);
        }

        private void type3check()
        {

            Form1.evl_allid = Form1.evl_allid + "；";
            if (Form1.evl_allid.IndexOf("(3)1-1") >= 0) { evl_3_1.Checked = true; evl_3_1.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(3)1-2") >= 0) { evl_3_2.Checked = true; evl_3_2.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(3)1-3") >= 0) { evl_3_3.Checked = true; evl_3_3.ForeColor = Color.Red; }
            if (Form1.evl_allid.IndexOf("(3)1-4") >= 0) { evl_3_4.Checked = true; evl_3_4.ForeColor = Color.Red; }
            Form1.evl_allid = Form1.evl_allid.Remove(Form1.evl_allid.LastIndexOf("；"), 1);

        }

        private void panduancheck()
        {
            type1check();
            type2check();
            type3check();
        }
        #endregion

        private void evlform_Load(object sender, EventArgs e)
        {
            panduancheck();
            richTextBox1.Text = Form1.evl_question;
        }
        //确定
        private void button1_Click(object sender, EventArgs e)
        {
            Form1.evl_question = "";
            Form1.evl_allid = "";
            Form1.evl_question = richTextBox1.Text;
            if (evl_1_1.Checked) { Form1.evl_allid = Form1.evl_allid + "(1)1-1；"; }
            if (evl_1_2.Checked) { Form1.evl_allid = Form1.evl_allid + "(1)1-2；"; }
            if (evl_1_3.Checked) { Form1.evl_allid = Form1.evl_allid + "(1)1-3；"; }
            if (evl_1_4.Checked) { Form1.evl_allid = Form1.evl_allid + "(1)1-4；"; }
            if (evl_1_5.Checked) { Form1.evl_allid = Form1.evl_allid + "(1)1-5；"; }
            if (evl_1_6.Checked) { Form1.evl_allid = Form1.evl_allid + "(1)1-6；"; }
            if (evl_1_7.Checked) { Form1.evl_allid = Form1.evl_allid + "(1)1-7；"; }
            if (evl_1_8.Checked) { Form1.evl_allid = Form1.evl_allid + "(1)1-8；"; }
            if (evl_1_9.Checked) { Form1.evl_allid = Form1.evl_allid + "(1)1-9；"; }
            if (evl_1_10.Checked) { Form1.evl_allid = Form1.evl_allid + "(1)1-10；"; }
            if (evl_1_11.Checked) { Form1.evl_allid = Form1.evl_allid + "(1)1-11；"; }
            if (evl_1_12.Checked) { Form1.evl_allid = Form1.evl_allid + "(1)1-12；"; }
            if (evl_1_13.Checked) { Form1.evl_allid = Form1.evl_allid + "(1)1-13；"; }
            if (evl_1_14.Checked) { Form1.evl_allid = Form1.evl_allid + "(1)1-14；"; }
            if (evl_1_15.Checked) { Form1.evl_allid = Form1.evl_allid + "(1)1-15；"; }
            if (evl_2_1.Checked) { Form1.evl_allid = Form1.evl_allid + "(2)1-1；"; }
            if (evl_2_2.Checked) { Form1.evl_allid = Form1.evl_allid + "(2)1-2；"; }
            if (evl_2_3.Checked) { Form1.evl_allid = Form1.evl_allid + "(2)1-3；"; }
            if (evl_2_4.Checked) { Form1.evl_allid = Form1.evl_allid + "(2)1-4；"; }
            if (evl_2_5.Checked) { Form1.evl_allid = Form1.evl_allid + "(2)1-5；"; }
            if (evl_2_6.Checked) { Form1.evl_allid = Form1.evl_allid + "(2)1-6；"; }
            if (evl_2_7.Checked) { Form1.evl_allid = Form1.evl_allid + "(2)1-7；"; }
            if (evl_2_8.Checked) { Form1.evl_allid = Form1.evl_allid + "(2)1-8；"; }
            if (evl_2_9.Checked) { Form1.evl_allid = Form1.evl_allid + "(2)1-9；"; }
            if (evl_3_1.Checked) { Form1.evl_allid = Form1.evl_allid + "(3)1-1；"; }
            if (evl_3_2.Checked) { Form1.evl_allid = Form1.evl_allid + "(3)1-2；"; }
            if (evl_3_3.Checked) { Form1.evl_allid = Form1.evl_allid + "(3)1-3；"; }
            if (evl_3_4.Checked) { Form1.evl_allid = Form1.evl_allid + "(3)1-4；"; }
            this.Close();
            if (Form1.evl_allid.LastIndexOf("；") >= 0)
            {
                Form1.evl_allid = Form1.evl_allid.Remove(Form1.evl_allid.LastIndexOf("；"), 1);
            }
        }
        //取消
        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
#region checkbox选中后颜色变化
        private void evl_1_1_Click(object sender, EventArgs e)
        {
            if (evl_1_1.Checked)
            {
                evl_1_1.ForeColor = Color.Red;
            }
            else { evl_1_1.ForeColor = Color.Black; }
        }

        private void evl_1_2_Click(object sender, EventArgs e)
        {
            if (evl_1_2.Checked)
            {
                evl_1_2.ForeColor = Color.Red;
            }
            else { evl_1_2.ForeColor = Color.Black; }
        }

        private void evl_1_3_Click(object sender, EventArgs e)
        {
            if (evl_1_3.Checked)
            {
                evl_1_3.ForeColor = Color.Red;
            }
            else { evl_1_3.ForeColor = Color.Black; }
        }

        private void evl_1_4_Click(object sender, EventArgs e)
        {
            if (evl_1_4.Checked)
            {
                evl_1_4.ForeColor = Color.Red;
            }
            else { evl_1_4.ForeColor = Color.Black; }
        }

        private void evl_1_5_Click(object sender, EventArgs e)
        {
            if (evl_1_5.Checked)
            {
                evl_1_5.ForeColor = Color.Red;
            }
            else { evl_1_5.ForeColor = Color.Black; }
        }

        private void evl_1_6_Click(object sender, EventArgs e)
        {
            if (evl_1_6.Checked)
            {
                evl_1_6.ForeColor = Color.Red;
            }
            else { evl_1_6.ForeColor = Color.Black; }
        }

        private void evl_1_7_Click(object sender, EventArgs e)
        {
            if (evl_1_7.Checked)
            {
                evl_1_7.ForeColor = Color.Red;
            }
            else { evl_1_7.ForeColor = Color.Black; }
        }

        private void evl_1_8_Click(object sender, EventArgs e)
        {
            if (evl_1_8.Checked)
            {
                evl_1_8.ForeColor = Color.Red;
            }
            else { evl_1_8.ForeColor = Color.Black; }
        }

        private void evl_1_9_Click(object sender, EventArgs e)
        {
            if (evl_1_9.Checked)
            {
                evl_1_9.ForeColor = Color.Red;
            }
            else { evl_1_9.ForeColor = Color.Black; }
        }

        private void evl_1_10_Click(object sender, EventArgs e)
        {
            if (evl_1_10.Checked)
            {
                evl_1_10.ForeColor = Color.Red;
            }
            else { evl_1_10.ForeColor = Color.Black; }
        }

        private void evl_1_11_Click(object sender, EventArgs e)
        {
            if (evl_1_11.Checked)
            {
                evl_1_11.ForeColor = Color.Red;
            }
            else { evl_1_11.ForeColor = Color.Black; }
        }

        private void evl_1_12_Click(object sender, EventArgs e)
        {
            if (evl_1_12.Checked)
            {
                evl_1_12.ForeColor = Color.Red;
            }
            else { evl_1_12.ForeColor = Color.Black; }
        }

        private void evl_1_13_Click(object sender, EventArgs e)
        {
            if (evl_1_13.Checked)
            {
                evl_1_13.ForeColor = Color.Red;
            }
            else { evl_1_13.ForeColor = Color.Black; }
        }

        private void evl_1_14_Click(object sender, EventArgs e)
        {
            if (evl_1_14.Checked)
            {
                evl_1_14.ForeColor = Color.Red;
            }
            else { evl_1_14.ForeColor = Color.Black; }
        }

        private void evl_1_15_Click(object sender, EventArgs e)
        {
            if (evl_1_15.Checked)
            {
                evl_1_15.ForeColor = Color.Red;
            }
            else { evl_1_15.ForeColor = Color.Black; }
        }

        private void evl_2_1_Click(object sender, EventArgs e)
        {
            if (evl_2_1.Checked)
            {
                evl_2_1.ForeColor = Color.Red;
            }
            else { evl_2_1.ForeColor = Color.Black; }
        }

        private void evl_2_2_Click(object sender, EventArgs e)
        {
            if (evl_2_2.Checked)
            {
                evl_2_2.ForeColor = Color.Red;
            }
            else { evl_2_2.ForeColor = Color.Black; }
        }

        private void evl_2_3_Click(object sender, EventArgs e)
        {
            if (evl_2_3.Checked)
            {
                evl_2_3.ForeColor = Color.Red;
            }
            else { evl_2_3.ForeColor = Color.Black; }
        }

        private void evl_2_4_Click(object sender, EventArgs e)
        {
            if (evl_2_4.Checked)
            {
                evl_2_4.ForeColor = Color.Red;
            }
            else { evl_2_4.ForeColor = Color.Black; }
        }

        private void evl_2_5_Click(object sender, EventArgs e)
        {
            if (evl_2_5.Checked)
            {
                evl_2_5.ForeColor = Color.Red;
            }
            else { evl_2_5.ForeColor = Color.Black; }
        }

        private void evl_2_6_Click(object sender, EventArgs e)
        {
            if (evl_2_6.Checked)
            {
                evl_2_6.ForeColor = Color.Red;
            }
            else { evl_2_6.ForeColor = Color.Black; }
        }

        private void evl_2_7_Click(object sender, EventArgs e)
        {
            if (evl_2_7.Checked)
            {
                evl_2_7.ForeColor = Color.Red;
            }
            else { evl_2_7.ForeColor = Color.Black; }
        }

        private void evl_2_8_Click(object sender, EventArgs e)
        {
            if (evl_2_8.Checked)
            {
                evl_2_8.ForeColor = Color.Red;
            }
            else { evl_2_8.ForeColor = Color.Black; }
        }

        private void evl_2_9_Click(object sender, EventArgs e)
        {
            if (evl_2_9.Checked)
            {
                evl_2_9.ForeColor = Color.Red;
            }
            else { evl_2_9.ForeColor = Color.Black; }
        }

        private void evl_3_1_Click(object sender, EventArgs e)
        {
            if (evl_3_1.Checked)
            {
                evl_3_1.ForeColor = Color.Red;
            }
            else { evl_3_1.ForeColor = Color.Black; }
        }

        private void evl_3_2_Click(object sender, EventArgs e)
        {
            if (evl_3_2.Checked)
            {
                evl_3_2.ForeColor = Color.Red;
            }
            else { evl_3_2.ForeColor = Color.Black; }
        }

        private void evl_3_3_Click(object sender, EventArgs e)
        {
            if (evl_3_3.Checked)
            {
                evl_3_3.ForeColor = Color.Red;
            }
            else { evl_3_3.ForeColor = Color.Black; }
        }

        private void evl_3_4_Click(object sender, EventArgs e)
        {
            if (evl_3_4.Checked)
            {
                evl_3_4.ForeColor = Color.Red;
            }
            else { evl_3_4.ForeColor = Color.Black; }
        }
#endregion
    }
}
